package com.wish.contract.utils;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.io.Serializable;

/**
 * 笔者   Andy
 * 描述: // TODO
 * 时间: 2022-06-02 11:40
 */
@Configuration
@EnableTransactionManagement
//@Transactional(rollbackFor = {RuntimeException.class})
public class PlusUtils  {
    @Bean
    public MybatisPlusInterceptor pageIterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }
}
